
setTimeout(function(){
	if( !$('left')){
		return setTimeout(arguments.callee, 50);
	}
	// hidefocus="true"  href="javascript:void(0)" 
	/* ========== 左侧的栏目 ========= */	
	try{
		$('_bodytitle').set('html', _AdminTitle[_LeftKey].join(' <small>&#187;</small> '));

		if( Browser.Engine.trident){
			$$('#_col a.a0').each(function(el){
				el.set('href', 'javascript:void(0)');
			});
		}

		$$("#_col .a0").addEvent('click', function(){
			this.toggleClass('a0').toggleClass('a1');
			this.getNext().toggleClass('v0').toggleClass('v1');
		});
		var nodes	= $$('#_col>a');
		_AdminTitle[_LeftKey].each(function(txt){
			nodes.some(function(node){
				if(node.get('text') === txt ){
					var el	=  node.getNext();
					if( el &&  el.tagName === 'DIV' ){
						el.removeClass('v0').addClass('v1');
						nodes	= $$(el.childNodes);
						if( nodes.length ){
							node.removeClass('a0').addClass('a1');
						}
					}else{

					}
					return true;
				}
			});
		});
		

	}catch(e){
		//alert(e.message)
	}
}, 30);

window.addEvent('domready', function(){
	/* ======== .bodytab width ============== */
	//mouseenter mouseleave
	
	if( Browser.Engine.trident){
		window.addEvent('resize', (function(){
			$$('.bodytab').setStyle('width', $('bodytitle').offsetWidth );
			return  arguments.callee;
		})());
	}

	/* ======== 箭头 ============== */
	$("arrow").addEvent('click', function(evt){
		$(document.body).toggleClass('leftview1').toggleClass('leftview0');
		if( Browser.Engine.trident){
			$$('.bodytab').setStyle('width', $('bodytitle').offsetWidth);
		}
		Cookie.write("leftview", $(document.body).hasClass('leftview1')? 1: 0);
	});

	/* ========== 颜色处理 ========== */
	$$("table.colortab>tbody>tr").addEvent('mouseenter', function(){
		if( !this.getFirst().hasClass('th') ){
			this.retrieve('xbg1', this.getFirst().getStyle('background-color') );
			this.getChildren().setStyle("background-color","#EEF");
		}
	}).addEvent('mouseleave', function(){
		var col	= this.retrieve('xbg1');
		if( col ){
			this.getChildren().setStyle("background-color", col);
		}
	});
	/* ========== 展开 ========== */
	$$('.updown0').addEvent('click', function(){
		try{
			var d = this.getNext();
			if( d.style.display!='none' ){
				d.style.display	= 'none';
				this.className	= "updown0";
				this.innerHTML	= "展开";
			}else{
				d.style.display	= 'block';
				this.className	= "updown1";
				this.innerHTML	= "关闭";
			}
		}catch(Err){
			alert(Err.message)
		}
	});
});
